<?php $jsearch = JRequest::getVar('jsearch') ; ?>

<!--[if IE 7]>
<style>
    .input-search .ar{
        margin: 0 5px -4px -14px !important;
    }
    #content-search{
        width: 367px;
    }
</style>
<![endif]-->

<!--[if IE 9]>
<style>
    .input-search .ar{
        margin-bottom: -6px !important;
    }
    #content-search{
        width: 367px;
    }
</style>
<![endif]-->
<?php if (stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE 10')) {?>
    <style>
    .input-search .ar{
        margin-bottom: -6px !important;
    }
    #content-search{
        width: 367px;
    }
</style>
<?php }?>
<div class="search-message">
    <div class="filter-search fltlft">
        <div style="position: relative;">
    		 <p class="input-search">
                <input type="text" name="title_search" value="<?php echo JRequest::getVar('title_search')?>" />
                <img src="components/com_frmessage/public/images/ar.jpg" class="ar" id="down-arrow" />
                <button class="input-button-search toolbar" id="searchtitle">検索</button>
             </p>
            <div style="position: absolute" id="content-search">
            <fieldset class="adminform">

                 <ul class="adminformlist">
                     <li >
                        <label>フォルダ </label>
                       <?php
                            $fol = array('all'=>'全て',
                                        'inbox'=>'受信トレイ',
                                        'sent'=>'送信済み',
                                        'trash'=>'ゴミ箱');

                            echo JHTML::_('Select.genericlist',array_merge($fol, $this->folders),"jsearch[folder]",'','FOME_CODE','FOME_NAME',$jsearch['folder']);
                       ?>

                     </li>

                     <li >
                        <label>送信者</label>
                        <input type="text" name="jsearch[sender]" value="<?php echo $jsearch['sender']?>" style="width: 75%;" />
                     </li>

                      <li >
                        <label>宛先</label>
                        <input type="text" name="jsearch[recipient]" value="<?php echo $jsearch['recipient']?>" style="width: 75%;" />
                     </li>

                      <li >
                        <label>件名</label>
                        <input type="text" name="jsearch[title]" value="<?php echo $jsearch['title']?>" style="width: 75%;"/>
                     </li>

                     <li  class="clear-float">
                        <label class="label-big">メールグループのID</label>
                        <input type="text" name="jsearch[id_mail_group]" value="<?php echo $jsearch['id_mail_group']?>" style="width: 56%;"/>
                     </li>

                     <li >
                        <label class="label-big">メールグループ名</label>
                        <input type="text" name="jsearch[name_mail_group]" value="<?php echo $jsearch['name_mail_group']?>" style="width: 56%;" />
                     </li>

                     <li >
                        <label>期間</label>
                        <?php echo JHtml::calendar($jsearch['dateFrom'], 'jsearch[dateFrom]', 'jformFrom',null, 'style="width:31.5%;"');?>
                        ~ <?php echo JHtml::calendar($jsearch['dateTo'], 'jsearch[dateTo]', 'jformTo',null, 'style="width:31.5%;"');?>
                     </li>

                     <li >
                        <label></label>
                        <input type="checkbox" <?php echo $jsearch['attachment'] ? 'checked="checked"':null?> name="jsearch[attachment]" />
                        <label class="label-big">添付ファイルあり</label>
                     </li>

                     <li >
                        <label class="float-right" >
                            <button class="toolbar" id="search">検索</button>
                        </label>

                        <label class="float-right label-big ">
                            <button id="cancel">クリア</button>
                        </label>
                     </li>
                 </ul>

               </fieldset>
            </div>
        </div>
        </div>
    </div>

    <div class="clearfix"></div>
    <div class="list-button">
        <button href="index.php?top=page&option=com_frmessage&task=add&noHead=true">作成</button>

         <button class="button-edit toolbar" id="delete">削除</button>
         <button class="button-edit toolbar" id="reply">返信</button>
         <button class="button-edit toolbar" id="forward">転送</button>
         <!--<button class="button-edit toolbar" id="edit">編集</button>-->


        <?php // khong xuat hien selectbox o draft va trash
        if(JRequest::getVar('cate') != 'draft'){
            echo JHTML::_('Select.genericlist',array_merge(array(0=>'移動'), $this->folders),"folders",'','FOME_CODE','FOME_NAME');
        }?>



    </div>
    <script>
        jq('.action').click(function(){
            jq('#action').val(jq(this).attr('id'));

        })

      window.addEvent('domready', function() {Calendar.setup({
            	// Id of the input field
            	inputField: "jformFrom",
            	// Format of the input field
            	ifFormat: "%Y/%m/%d",
            	// Trigger for the calendar (button ID)
            	button: "jformFrom",
            	// Alignment (defaults to "Bl")
            	align: "Bl",
            	singleClick: true,
            	firstDay: 0
        	});
        });

         window.addEvent('domready', function() {Calendar.setup({
            	// Id of the input field
            	inputField: "jformTo",
            	// Format of the input field
            	ifFormat: "%Y/%m/%d",
            	// Trigger for the calendar (button ID)
            	button: "jformTo",
            	// Alignment (defaults to "Bl")
            	align: "Bl",
            	singleClick: true,
            	firstDay: 0
        	});
        });

</script>